# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023/10/22
desc: 
sample: 
"""
name='testfan'
#切片
print(name[::-1])

#reversed 函数
#print(list(reversed(name)))
#list-str
print("".join(list(reversed(name)))) #ok

#reverse
str_list = list(name)
str_list.reverse() #None
print("".join(str_list))
#print("".join(list(name).reverse())) #有问题的

#索引
newStr=''
namelen = len(name)
for i in range(namelen):
    newStr+=name[namelen-i-1]

print(newStr)



